﻿using BS.Infra;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BS.Write.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SlaughterEnterpriseController : ControllerBase
    {
        private readonly IMediator _mediator;

        public SlaughterEnterpriseController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 新增屠宰企业信息
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> InsertSlaughterEnterprise(AddSlaughterEnterpriseCommand command)
        {
            return await _mediator.Send(command);
        }
    }
}
